<template>
	<view v-if="proDetail">
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="item in proDetail.banners" :key="item">
				<view class="swiper-item">
					 <image :src="item" mode=""></image> 
				</view>
			</swiper-item>
		</swiper>
		
		<view class="">
			{{proDetail.proname}}
		</view>
	</view>
	<view v-else>
		<!-- 骨架屏 -->
	</view>
</template>

<script>
	import {getDetailData} from '../../api/home.js'
	export default {
		data() {
			return {
				proDetail: null
			}
		},
		onLoad(options) {
			// console.log(11111,options);
			
			const _this = this
			
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.on('proid', function(data) {
			    // console.log(2222,data)
				getDetailData(data.proid).then(res => {
					// console.log(123321,res);
					res.data.banners = res.data.banners[0].split(',')
					// console.log(12345678,res.data);
					_this.proDetail = res.data
				})
			
				
			})
		},
		methods: {
			
		}
	}
</script>

<style scoped lang="scss">
	swiper {
		height: 350px;
		width: 100%;
		image {
			width: 100%;
			height: 350px;
		}
	}

</style>
